package com.explorati.design_pattern.structural.flyweight.v2;

import java.util.HashMap;
import java.util.Map;

public class CircleFactory {

	private static final Map<String, Circle> CircleR = new HashMap<>();

	public static Circle getCircle(String color) {
		Circle circle = CircleR.get(color);
		if (circle == null) {
			circle = new Circle(color);
			CircleR.put(color, circle);
		}
		return circle;
	}
}
